import CButton from "./packages/button/index.js";
import CDragBox from "./packages/dragBox/index.js";
import CTab from "./packages/tab/index.js";
import CLoadingBar from "./packages/loadingBar/index.js";

const components = [CButton, CDragBox, CTab,CLoadingBar];

const install = function (Vue, opts = {}) {
  components.map((component) => {
    Vue.component(component.name, component);
  });
};

/* 支持使用标签的方式引入 */
if (typeof window !== "undefined" && window.Vue) {
  install(window.Vue);
}

export default {
  install,
  CButton,
  CDragBox,
  CTab,
  CLoadingBar
};
